package cn.dansj.common.processor;

import java.lang.reflect.Method;
import java.util.Objects;

class Version {
    static String NullVersion = "0.0.0.0";

    static String getSpringBootVersion() {
        try {
            Class<?> versionClass = Class.forName("org.springframework.boot.SpringBootVersion");
            Method getVersion = versionClass.getDeclaredMethod("getVersion");
            return Objects.toString(getVersion.invoke(versionClass), NullVersion);
        } catch (Throwable e) {
            return NullVersion;
        }
    }
}
